package zhongche.bean;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

import java.util.Map;
import java.util.Objects;

public class TrainInfo {


    /**
     * 列车号ID
     */
    @JSONField(name = "train_id")
    private Integer trainId;
    /**
     * 列车号
     */
    @JSONField(name = "train_name")
    private String trainName;

    /**
     * 车型代码
     */
    @JSONField(name = "train_type")
    private String trainType;

    /**
     * 车型ID
     */
    @JSONField(name = "ttype_id")
    private Integer ttypeId;

    /**
     * 设备下发时间210716153626 = 21年07月16号15时36分26秒
     */
    private String sDeviceTime;


    /**
     * 线路id
     */
    @JSONField(name = "line_id")
    private Integer lineId;

    /**
     * 线路号
     */
    @JSONField(name = "line_num")
    private String lineNum;

    /**
     * 信号数据
     */
    private Map<String,Integer> dataParam;

    public Integer getTrainId() {
        return trainId;
    }

    public void setTrainId(Integer trainId) {
        this.trainId = trainId;
    }

    public String getTrainName() {
        return trainName;
    }

    public void setTrainName(String trainName) {
        this.trainName = trainName;
    }

    public String getTrainType() {
        return trainType;
    }

    public void setTrainType(String trainType) {
        this.trainType = trainType;
    }

    public Integer getTtypeId() {
        return ttypeId;
    }

    public void setTtypeId(Integer ttypeId) {
        this.ttypeId = ttypeId;
    }

    public String getsDeviceTime() {
        return sDeviceTime;
    }

    public void setsDeviceTime(String sDeviceTime) {
        this.sDeviceTime = sDeviceTime;
    }

    public Integer getLineId() {
        return lineId;
    }

    public void setLineId(Integer lineId) {
        this.lineId = lineId;
    }

    public String getLineNum() {
        return lineNum;
    }

    public void setLineNum(String lineNum) {
        this.lineNum = lineNum;
    }

    public Map<String, Integer> getDataParam() {
        return dataParam;
    }

    public void setDataParam(Map<String, Integer> dataParam) {
        this.dataParam = dataParam;
    }

    @Override
    public String toString() {
        return "TrainInfo{" +
                "trainId=" + trainId +
                ", trainName='" + trainName + '\'' +
                ", trainType='" + trainType + '\'' +
                ", ttypeId=" + ttypeId +
                ", sDeviceTime='" + sDeviceTime + '\'' +
                ", lineId=" + lineId +
                ", lineNum='" + lineNum + '\'' +
                ", dataParam=" + dataParam +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TrainInfo trainInfo = (TrainInfo) o;
        return Objects.equals(trainId, trainInfo.trainId) &&
                Objects.equals(trainName, trainInfo.trainName) &&
                Objects.equals(trainType, trainInfo.trainType) &&
                Objects.equals(ttypeId, trainInfo.ttypeId) &&
                Objects.equals(sDeviceTime, trainInfo.sDeviceTime) &&
                Objects.equals(lineId, trainInfo.lineId) &&
                Objects.equals(lineNum, trainInfo.lineNum) &&
                Objects.equals(dataParam, trainInfo.dataParam);
    }

    @Override
    public int hashCode() {
        return Objects.hash(trainId, trainName, trainType, ttypeId, sDeviceTime, lineId, lineNum, dataParam);
    }
}
